<?php
header("Content-Type: text/html; charset=iso-8859-1");
class commission{
	var $fields;	
	function commission($id,$field = 'id'){	
		$fields = describe('commissions');
		$q = "select * from commissions where $field = '$id'";
		$r = ExecRequete($q);
		if(!mysql_num_rows($r)){
#			echo "Aucune commission n'a &eacute;t&eacute; trouv&eacute;e";
			foreach($fields as $field => $type) $this->$field = "";
		}
		else{
			$s = LigneSuivante($r);
			foreach($fields as $field => $type){
				$this->$field = $s->$field;
			}
		}
	}
	function membres(){
		$membres = array();
		$q = "select membre_id, fonction from membre_commissions where commission_id = '$this->id' order by num asc";
		$r = ExecRequete($q);
		while($s = LigneSuivante($r)){
			$membres[$s->membre_id] = utf8_decode($s->fonction);
		}
		return $membres;
	}
}

?>